-
Notifications
You must be signed in to change notification settings - Fork 21
[DO NOT MERGE] Local authority api with Fake results (leave in place for the moment) #4720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
KludgeKML
wants to merge
6
commits into
main
Choose a base branch
from
local-authority-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- to house anything we need across multiple apis
- addresses_with_authority_data returns an array of the addresses with local authority slug and name, suitable for presenting from the app.
6bc6a3c
to
4bce952
Compare
64fab21
to
78f8134
Compare
78f8134
to
1662085
Compare
1662085
to
6b2e423
Compare
6b2e423
to
70315ec
Compare
70315ec
to
5ef72b1
Compare
- this is genuinely an API, so rather than serving it as a separate format on the existing /find-local-council endpoint, we just make it its own thing, which allows us to restrict it / update it independently of the other controller. Since we've simplified the code in the existing find_local_council controller, the index method in the new controller is basically a direct copy of the find method - you're expected to call it with a query parameter, there isn't currently a simple index that lists all local authorities. - the query is a GET - in the web interface it's a POST, but that's largely for privacy. The lookup is extremely cacheable at the CDN level - it might change less than one time a year - so we might as well take advantage of that. - status codes are 301 (redirect straight to a local authority url to be added in a subsequent commit), 200 (a list of addresses to choose from if the postcode crosses boundaries), 404 (postcode is structurally valid but not found in the database), or 400 (postcode query parameter is missing or not valid).
… the parent if present.
- This is much simpler, at this point we're just doing slug lookups and returning a 404 or the local authority hash (including the parent hash if there is one).
5ef72b1
to
1ce1a8d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This is a version of this actual PR:
#4770
Why
to add dummy data so that this endpoint can be called from a preview app (which otherwise wouldn't work since they can't access locations-api or Local Links Manager)